﻿using System;
using System.ComponentModel;

namespace EnsureWeb.UI.Core
{
    public class ViewModelLocator<T> where T : new()
    {
        public static T viewModel;
        public static T ViewModel
        {
            get
            {
                if (viewModel == null)
                    viewModel = new T();

                return viewModel;
            }
        }
        
        public T Model
        {
            get
            {
                return ViewModel;
            }
            
        }

        public ViewModelLocator()
        {
        }
    }
}
